const http = require('http');
const fs = require('fs');
const {httpReadFile} = require('./utils/file-util')
const server = http.createServer();

server.listen(5555, function () {
    console.log("留言板服务启动成功~");
})


server.on('request', function (request, response) {
    if (request.url === '/') {
        httpReadFile('./views/index.html',response)

    } else {
        fs.readFile('./views/error.html', function (error,data) {
            response.end(data)
        })
        httpReadFile('')
    }
})


